package com.truth.lock.configure.redisson;

import com.truth.lock.enumeration.RedissonType;
import org.redisson.config.MasterSlaveServersConfig;
import org.redisson.config.ReplicatedServersConfig;
import org.redisson.config.SentinelServersConfig;
import org.redisson.config.SingleServerConfig;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * redisson服务器配置
 * @author truth
 */
public class RedissonProperties {

    /**
     * 类型,默认单机
     */
    private RedissonType type = RedissonType.SINGLE;

    /**
     * 单机Redisson
     */
    @NestedConfigurationProperty
    private SingleServerConfig single;
    /**
     * 主从redisson
     */
    @NestedConfigurationProperty
    private MasterSlaveServersConfig masterSlave;
    /**
     * 复制redisson
     */
    @NestedConfigurationProperty
    private ReplicatedServersConfig replicate;
    /**
     * 哨兵redisson
     */
    @NestedConfigurationProperty
    private SentinelServersConfig sentinel;

    public RedissonType getType() {
        return type;
    }

    public void setType(RedissonType type) {
        this.type = type;
    }

    public SingleServerConfig getSingle() {
        return single;
    }

    public void setSingle(SingleServerConfig single) {
        this.single = single;
    }

    public MasterSlaveServersConfig getMasterSlave() {
        return masterSlave;
    }

    public void setMasterSlave(MasterSlaveServersConfig masterSlave) {
        this.masterSlave = masterSlave;
    }

    public ReplicatedServersConfig getReplicate() {
        return replicate;
    }

    public void setReplicate(ReplicatedServersConfig replicate) {
        this.replicate = replicate;
    }

    public SentinelServersConfig getSentinel() {
        return sentinel;
    }

    public void setSentinel(SentinelServersConfig sentinel) {
        this.sentinel = sentinel;
    }
}
